<?php

/**
 * defis actions.
 *
 * @package    sf_sandbox
 * @subpackage defis
 * @author     Your name here
 * @version    SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class defisActions extends sfActions
{
 /**
  * Executes index action
  *
  * @param sfRequest $request A request object
  */
  public function executeIndex(sfWebRequest $request)
  {
  
  }
  
  public function executeFiche(sfWebRequest $request)
  {
 	$id = $request->getParameter('id');
  	$this->oDefis = Doctrine::getTable('Defis')->find($id);
  	$this->forward404If(!$this->oDefis);
	$this->forward404If($this->oDefis->etat == 'disable');
  	
	$request->setParameter('titre', $this->oDefis->titre);
    if ($this->oDefis->etat == 'terminate')
    	$this->forward('defis/defisTermine?id='. $id);
  }

  
  public function executeDefisActif(sfWebRequest $request)
  {
  	// Liste des defis en ligne
  	$this->aListeDefis = DefisTable::getOnlineDefi();
  }
  
  public function executeDefisTermine(sfWebRequest $request)
  {

  }
}
